<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Class: SQLRConnection</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Class</strong></td>
          <td class="class-name-in-header">SQLRConnection</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../files/sqlrelay_cpp.html">
                sqlrelay.cpp
                </a>
        <br />
            </td>
        </tr>

        <tr class="top-aligned-row">
            <td><strong>Parent:</strong></td>
            <td>
                Object
            </td>
        </tr>
        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">



   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M000105">autoCommitOff</a>&nbsp;&nbsp;
      <a href="#M000104">autoCommitOn</a>&nbsp;&nbsp;
      <a href="#M000106">begin</a>&nbsp;&nbsp;
      <a href="#M000100">bindFormat</a>&nbsp;&nbsp;
      <a href="#M000099">clientVersion</a>&nbsp;&nbsp;
      <a href="#M000107">commit</a>&nbsp;&nbsp;
      <a href="#M000096">dbHostName</a>&nbsp;&nbsp;
      <a href="#M000097">dbIpAddress</a>&nbsp;&nbsp;
      <a href="#M000095">dbVersion</a>&nbsp;&nbsp;
      <a href="#M000112">debugOff</a>&nbsp;&nbsp;
      <a href="#M000111">debugOn</a>&nbsp;&nbsp;
      <a href="#M000088">endSession</a>&nbsp;&nbsp;
      <a href="#M000109">errorMessage</a>&nbsp;&nbsp;
      <a href="#M000110">errorNumber</a>&nbsp;&nbsp;
      <a href="#M000115">getClientInfo</a>&nbsp;&nbsp;
      <a href="#M000090">getConnectionPort</a>&nbsp;&nbsp;
      <a href="#M000091">getConnectionSocket</a>&nbsp;&nbsp;
      <a href="#M000102">getCurrentDatabase</a>&nbsp;&nbsp;
      <a href="#M000113">getDebug</a>&nbsp;&nbsp;
      <a href="#M000103">getLastInsertId</a>&nbsp;&nbsp;
      <a href="#M000094">identify</a>&nbsp;&nbsp;
      <a href="#M000086">new</a>&nbsp;&nbsp;
      <a href="#M000093">ping</a>&nbsp;&nbsp;
      <a href="#M000092">resumeSession</a>&nbsp;&nbsp;
      <a href="#M000108">rollback</a>&nbsp;&nbsp;
      <a href="#M000101">selectDatabase</a>&nbsp;&nbsp;
      <a href="#M000098">serverVersion</a>&nbsp;&nbsp;
      <a href="#M000114">setClientInfo</a>&nbsp;&nbsp;
      <a href="#M000087">setConnectTimeout</a>&nbsp;&nbsp;
      <a href="#M000089">suspendSession</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->

    <div id="section">





      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Class methods</h3>

      <div id="method-M000086" class="method-detail">
        <a name="M000086"></a>

        <div class="method-heading">
          <a href="SQLRConnection.src/M000086.html" target="Code" class="method-signature"
            onclick="popupCode('SQLRConnection.src/M000086.html');return false;">
          <span class="method-name">new(host, port, socket, user, password, retrytime, tries)<br />
</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Initiates a connection to &quot;host&quot; on &quot;port&quot; or to the
unix &quot;socket&quot; on the local machine and authenticates with
&quot;user&quot; and &quot;password&quot;. Failed connections will be
retried for &quot;tries&quot; times on interval &quot;retrytime&quot;. If
&quot;tries&quot; is 0 then retries will continue forever. If
&quot;retrytime&quot; is 0 then retries will be attempted on a default
interval. If the &quot;socket&quot; parameter is nether nil nor
&quot;&quot; then an attempt will be made to connect through it before
attempting to connect to &quot;host&quot; on &quot;port&quot;. If it is nil
or &quot;&quot; then no attempt will be made to connect through the socket.
</p>
        </div>
      </div>

      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M000105" class="method-detail">
        <a name="M000105"></a>

        <div class="method-heading">
          <a href="SQLRConnection.src/M000105.html" target="Code" class="method-signature"
            onclick="popupCode('SQLRConnection.src/M000105.html');return false;">
          <span class="method-name">autoCommitOff</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Instructs the database to wait for the client to tell it when to <a
href="SQLRConnection.html#M000107">commit</a>.
</p>
        </div>
      </div>

      <div id="method-M000104" class="method-detail">
        <a name="M000104"></a>

        <div class="method-heading">
          <a href="SQLRConnection.src/M000104.html" target="Code" class="method-signature"
            onclick="popupCode('SQLRConnection.src/M000104.html');return false;">
          <span class="method-name">autoCommitOn</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Instructs the database to perform a <a
href="SQLRConnection.html#M000107">commit</a> after every successful query.
</p>
        </div>
      </div>

      <div id="method-M000106" class="method-detail">
        <a name="M000106"></a>

        <div class="method-heading">
          <a href="SQLRConnection.src/M000106.html" target="Code" class="method-signature"
            onclick="popupCode('SQLRConnection.src/M000106.html');return false;">
          <span class="method-name">begin</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Begins a transaction. Returns true if the <a
href="SQLRConnection.html#M000106">begin</a> succeeded, false if it failed.
If the database automatically begins a <a
href="SQLRConnection.html#M000086">new</a> transaction when a <a
href="SQLRConnection.html#M000107">commit</a> or <a
href="SQLRConnection.html#M000108">rollback</a> is issued then this
doesn&#8216;t do anything unless SQL Relay is faking transaction blocks.
</p>
        </div>
      </div>

      <div id="method-M000100" class="method-detail">
        <a name="M000100"></a>

        <div class="method-heading">
          <a href="SQLRConnection.src/M000100.html" target="Code" class="method-signature"
            onclick="popupCode('SQLRConnection.src/M000100.html');return false;">
          <span class="method-name">bindFormat</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns a string representing the format of the bind variables used in the
db.
</p>
        </div>
      </div>

      <div id="method-M000099" class="method-detail">
        <a name="M000099"></a>

        <div class="method-heading">
          <a href="SQLRConnection.src/M000099.html" target="Code" class="method-signature"
            onclick="popupCode('SQLRConnection.src/M000099.html');return false;">
          <span class="method-name">clientVersion</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns the version of the sqlrelay client software.
</p>
        </div>
      </div>

      <div id="method-M000107" class="method-detail">
        <a name="M000107"></a>

        <div class="method-heading">
          <a href="SQLRConnection.src/M000107.html" target="Code" class="method-signature"
            onclick="popupCode('SQLRConnection.src/M000107.html');return false;">
          <span class="method-name">commit</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Issues a <a href="SQLRConnection.html#M000107">commit</a>. Returns true if
the <a href="SQLRConnection.html#M000107">commit</a> succeeded, false if it
failed.
</p>
        </div>
      </div>

      <div id="method-M000096" class="method-detail">
        <a name="M000096"></a>

        <div class="method-heading">
          <a href="SQLRConnection.src/M000096.html" target="Code" class="method-signature"
            onclick="popupCode('SQLRConnection.src/M000096.html');return false;">
          <span class="method-name">dbHostName</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns the host name of the database
</p>
        </div>
      </div>

      <div id="method-M000097" class="method-detail">
        <a name="M000097"></a>

        <div class="method-heading">
          <a href="SQLRConnection.src/M000097.html" target="Code" class="method-signature"
            onclick="popupCode('SQLRConnection.src/M000097.html');return false;">
          <span class="method-name">dbIpAddress</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns the ip address of the database
</p>
        </div>
      </div>

      <div id="method-M000095" class="method-detail">
        <a name="M000095"></a>

        <div class="method-heading">
          <a href="SQLRConnection.src/M000095.html" target="Code" class="method-signature"
            onclick="popupCode('SQLRConnection.src/M000095.html');return false;">
          <span class="method-name">dbVersion</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns the version of the database
</p>
        </div>
      </div>

      <div id="method-M000112" class="method-detail">
        <a name="M000112"></a>

        <div class="method-heading">
          <a href="SQLRConnection.src/M000112.html" target="Code" class="method-signature"
            onclick="popupCode('SQLRConnection.src/M000112.html');return false;">
          <span class="method-name">debugOff</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Turns debugging off.
</p>
        </div>
      </div>

      <div id="method-M000111" class="method-detail">
        <a name="M000111"></a>

        <div class="method-heading">
          <a href="SQLRConnection.src/M000111.html" target="Code" class="method-signature"
            onclick="popupCode('SQLRConnection.src/M000111.html');return false;">
          <span class="method-name">debugOn</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Causes verbose debugging information to be sent to standard output. Another
way to do this is to start a query with &quot;&#8212; debug\n&quot;. Yet
another way is to set the environment variable SQLR_CLIENT_DEBUG to
&quot;ON&quot;
</p>
        </div>
      </div>

      <div id="method-M000088" class="method-detail">
        <a name="M000088"></a>

        <div class="method-heading">
          <a href="SQLRConnection.src/M000088.html" target="Code" class="method-signature"
            onclick="popupCode('SQLRConnection.src/M000088.html');return false;">
          <span class="method-name">endSession</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Ends the session.
</p>
        </div>
      </div>

      <div id="method-M000109" class="method-detail">
        <a name="M000109"></a>

        <div class="method-heading">
          <a href="SQLRConnection.src/M000109.html" target="Code" class="method-signature"
            onclick="popupCode('SQLRConnection.src/M000109.html');return false;">
          <span class="method-name">errorMessage</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
If an operation failed and generated an error, the error message is
available here. If there is no error then this method returns nil
</p>
        </div>
      </div>

      <div id="method-M000110" class="method-detail">
        <a name="M000110"></a>

        <div class="method-heading">
          <a href="SQLRConnection.src/M000110.html" target="Code" class="method-signature"
            onclick="popupCode('SQLRConnection.src/M000110.html');return false;">
          <span class="method-name">errorNumber</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
If an operation failed and generated an error, the error number is
available here. If there is no error then this method returns 0.
</p>
        </div>
      </div>

      <div id="method-M000115" class="method-detail">
        <a name="M000115"></a>

        <div class="method-heading">
          <a href="SQLRConnection.src/M000115.html" target="Code" class="method-signature"
            onclick="popupCode('SQLRConnection.src/M000115.html');return false;">
          <span class="method-name">getClientInfo</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns the string that was set by <a
href="SQLRConnection.html#M000114">setClientInfo</a>().
</p>
        </div>
      </div>

      <div id="method-M000090" class="method-detail">
        <a name="M000090"></a>

        <div class="method-heading">
          <a href="SQLRConnection.src/M000090.html" target="Code" class="method-signature"
            onclick="popupCode('SQLRConnection.src/M000090.html');return false;">
          <span class="method-name">getConnectionPort</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns the inet port that the connection is communicating over. This
parameter may be passed to another connection for use in the
sqlrcon_resumeSession() command. Note: The result this function returns is
only valid after a call to <a
href="SQLRConnection.html#M000089">suspendSession</a>().
</p>
        </div>
      </div>

      <div id="method-M000091" class="method-detail">
        <a name="M000091"></a>

        <div class="method-heading">
          <a href="SQLRConnection.src/M000091.html" target="Code" class="method-signature"
            onclick="popupCode('SQLRConnection.src/M000091.html');return false;">
          <span class="method-name">getConnectionSocket</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns the unix socket that the connection is communicating over. This
parameter may be passed to another connection for use in the
sqlrcon_resumeSession() command. Note: The result this function returns is
only valid after a call to <a
href="SQLRConnection.html#M000089">suspendSession</a>().
</p>
        </div>
      </div>

      <div id="method-M000102" class="method-detail">
        <a name="M000102"></a>

        <div class="method-heading">
          <a href="SQLRConnection.src/M000102.html" target="Code" class="method-signature"
            onclick="popupCode('SQLRConnection.src/M000102.html');return false;">
          <span class="method-name">getCurrentDatabase</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns the database/schema that is currently in use.
</p>
        </div>
      </div>

      <div id="method-M000113" class="method-detail">
        <a name="M000113"></a>

        <div class="method-heading">
          <a href="SQLRConnection.src/M000113.html" target="Code" class="method-signature"
            onclick="popupCode('SQLRConnection.src/M000113.html');return false;">
          <span class="method-name">getDebug</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns 0 if debugging is off and 1 if debugging is on.
</p>
        </div>
      </div>

      <div id="method-M000103" class="method-detail">
        <a name="M000103"></a>

        <div class="method-heading">
          <a href="SQLRConnection.src/M000103.html" target="Code" class="method-signature"
            onclick="popupCode('SQLRConnection.src/M000103.html');return false;">
          <span class="method-name">getLastInsertId</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns the value of the autoincrement column for the last insert
</p>
        </div>
      </div>

      <div id="method-M000094" class="method-detail">
        <a name="M000094"></a>

        <div class="method-heading">
          <a href="SQLRConnection.src/M000094.html" target="Code" class="method-signature"
            onclick="popupCode('SQLRConnection.src/M000094.html');return false;">
          <span class="method-name">identify</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns the type of database: oracle, postgresql, mysql, etc.
</p>
        </div>
      </div>

      <div id="method-M000093" class="method-detail">
        <a name="M000093"></a>

        <div class="method-heading">
          <a href="SQLRConnection.src/M000093.html" target="Code" class="method-signature"
            onclick="popupCode('SQLRConnection.src/M000093.html');return false;">
          <span class="method-name">ping</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns 1 if the database is up and 0 if it&#8216;s down.
</p>
        </div>
      </div>

      <div id="method-M000092" class="method-detail">
        <a name="M000092"></a>

        <div class="method-heading">
          <a href="SQLRConnection.src/M000092.html" target="Code" class="method-signature"
            onclick="popupCode('SQLRConnection.src/M000092.html');return false;">
          <span class="method-name">resumeSession(port,socket)<br />
</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Resumes a session previously left open using sqlrcon_suspendSession().
Returns 1 on success and 0 on failure.
</p>
        </div>
      </div>

      <div id="method-M000108" class="method-detail">
        <a name="M000108"></a>

        <div class="method-heading">
          <a href="SQLRConnection.src/M000108.html" target="Code" class="method-signature"
            onclick="popupCode('SQLRConnection.src/M000108.html');return false;">
          <span class="method-name">rollback</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Issues a <a href="SQLRConnection.html#M000108">rollback</a>. Returns true
if the <a href="SQLRConnection.html#M000108">rollback</a> succeeded, false
if it failed.
</p>
        </div>
      </div>

      <div id="method-M000101" class="method-detail">
        <a name="M000101"></a>

        <div class="method-heading">
          <a href="SQLRConnection.src/M000101.html" target="Code" class="method-signature"
            onclick="popupCode('SQLRConnection.src/M000101.html');return false;">
          <span class="method-name">selectDatabase(database)<br />
</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Sets the current database/schema to &quot;database&quot;
</p>
        </div>
      </div>

      <div id="method-M000098" class="method-detail">
        <a name="M000098"></a>

        <div class="method-heading">
          <a href="SQLRConnection.src/M000098.html" target="Code" class="method-signature"
            onclick="popupCode('SQLRConnection.src/M000098.html');return false;">
          <span class="method-name">serverVersion</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns the version of the sqlrelay server software.
</p>
        </div>
      </div>

      <div id="method-M000114" class="method-detail">
        <a name="M000114"></a>

        <div class="method-heading">
          <a href="SQLRConnection.src/M000114.html" target="Code" class="method-signature"
            onclick="popupCode('SQLRConnection.src/M000114.html');return false;">
          <span class="method-name">setClientInfo(clientinfo)<br />
</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Allows you to set a string that will be passed to the server and ultimately
included in server-side logging along with queries that were run by this
instance of the client.
</p>
        </div>
      </div>

      <div id="method-M000087" class="method-detail">
        <a name="M000087"></a>

        <div class="method-heading">
          <a href="SQLRConnection.src/M000087.html" target="Code" class="method-signature"
            onclick="popupCode('SQLRConnection.src/M000087.html');return false;">
          <span class="method-name">setConnectTimeout(timeoutsec,timeoutusec)<br />
</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Sets the server connect timeout in seconds and milliseconds. Setting either
parameter to -1 disables the timeout. You can also set this timeout using
the SQLR_CLIENT_CONNECT_TIMEOUT environment variable.
</p>
        </div>
      </div>

      <div id="method-M000089" class="method-detail">
        <a name="M000089"></a>

        <div class="method-heading">
          <a href="SQLRConnection.src/M000089.html" target="Code" class="method-signature"
            onclick="popupCode('SQLRConnection.src/M000089.html');return false;">
          <span class="method-name">suspendSession</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Disconnects this connection from the current session but leaves the session
open so that another connection can connect to it using
sqlrcon_resumeSession().
</p>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>
